<#list fieldList as field>
    <#if field.isEnum>
    <#-- ========================== -->
    <#-- 提取字段注释中的描述与枚举值 -->
        <#assign commentText = field.fieldComment?trim>
        <#assign parts = commentText?split(" ")/>
    <#-- 第一部分为描述 -->
        <#assign fieldDesc = parts[0]>
    <#-- 枚举内容部分 -->
        <#assign enumPart = commentText?replace("^.*?\\s", "")>
    <#-- 替换中文顿号、空格为英文逗号，方便分割 -->
        <#assign enumPart = enumPart?replace("、", ",")>
        <#assign enumPart = enumPart?replace(" ", ",")>
        <#assign enumPart = enumPart?replace(fieldDesc+",", "")>
        <#assign enumArr = enumPart?split(",")>

    <#-- 解析键值对 -->
        <#assign enumPairs = []>
        <#list 0..enumArr?size-1 as i>
            <#if i%2==0 && (i+1)<enumArr?size>
                <#assign pair = {"code": enumArr[i], "text": enumArr[i+1]}>
                <#assign enumPairs += [pair]>
            </#if>
        </#list>

==============================================${field.commentSplit}枚举=============================================
import com.aizuda.trans.enums.IEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* ${field.commentSplit}枚举
* @author ${author} ${email}
* @date ${date}
*/
@Getter
@AllArgsConstructor
public enum ${field.attrName?cap_first}Enum implements IEnum {

<#-- 输出每个枚举项 -->
<#list enumPairs as item>
    ${item.text}("${item.code}", "${item.text}")<#if item_has_next>,<#else>;</#if>
</#list>

    ${field.attrName?cap_first}Enum(String code, String text) {
        init(code, text);
    }
}
</#if>
</#list>
